<%@ page language="java" pageEncoding="UTF-8"%>

  </head>
  		<script type="text/javascript">
		$(function(){
				jQuery("#_moduleGrid").jqGrid({
				   	url: "{base}/module_getRoleOfModule/{roleId}",
					datatype: "json",
				   	colNames:['ID','模块名称','角色模块关联关系'],
				   	colModel:[
				   		{name:'id',index:'id', width:55, align:'center',hidden:true},
				   		{name:'modulename', index:'modulename', align:'center'},
				   		{name:'relationid', index:'relationid', align:'center',hidden:true},
				   	],
				   	width:900,
				   	height:230,
				   	rowNum:10,
				   	rowList:[10,20,30],
				   	pager: '#_moduleBar',
				   	sortname: 'id',
				    viewrecords: true,
				    sortorder: "desc",
					multiselect: true,
					jsonReader: {
						repeatitems : false
					},
					rownumbers : true,
					caption: "角色设置模块",
					onSelectRow : function(id,status){
						$.post("{base}/role_roleAddModule/${roleId}",
							"moduleId="+id+"&status="+status, 
							function(response) {
								if(response && response.success == true) {
									alert(response.msg);
								} else {
									alert(response.msg);
								}
						}, "json");
					},
					onSelectAll : function(aRowids,status){
						for(var k=0;k<aRowids.length;k++){
							
						}
					},
					afterInsertRow : function(rowid, data) {
						if(data.relationid==null||data.relationid=="null"){
							
						}else{
							$("#_moduleGrid").setSelection(rowid);
						}
							
					}
				});
				jQuery("#_moduleGrid").jqGrid('navGrid','#_moduleBar',{add : false, del : false, edit : false, refresh : true, search : false});
		});
		</script>
	<body>
	<table cellpadding="0" cellspacing="0" border="0" width="99%" style="height:100%;">
		<tr><td style="height:10px; overflow:hidden;" colspan="2"></td></tr>
		<tr>
			<!--右边内容-->
			<td width="*" valign="top" class="contList">
				<div id="_moduleManagerDiv">
					<!-- 显示商家列表 --> 
						<table id="_moduleGrid"></table>
						<div id="_moduleBar"></div>
				</div>
				
			</td>
	</table>
	</body>
</html>
